'use strict';
const URL = require('url-parse');

exports.transformReq = function * (next) {
  const reqBody = this.request.body;
  const {url} = reqBody;
  const _interface = new URL(url).pathname;
  console.log(`interface: ${_interface}`);
  this.request.body = Object.assign({}, reqBody, {interface: _interface});
  yield next;
}
